package com.example.feign;


import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

import com.netflix.hystrix.HystrixCircuitBreaker;

import com.netflix.hystrix.HystrixCommandKey;



/**
 * Created by EalenXie on 2018/10/12 18:32.
 */
@RestController
//@RequestMapping(value = "/webapi")
public class FeignOpenClientController {

    @Resource
    private GitHubApiClient gitHubApiClient;
    @ResponseBody
    @RequestMapping("/getbook")
    public String searchGithubRepositoryByName(/*@RequestBody Map<String, Object> book*/) {
        String str = gitHubApiClient.getbook(new HashMap<String, Object>());
        return str;
    }

    @ResponseBody
    @RequestMapping("/webapi/myname")
    public Object myname() {
       Object obj = gitHubApiClient.myname(new HashMap<String, Object>());
       return obj;
    }

    @ResponseBody
    @RequestMapping("/hello")
    public String hello()
    {
        return "hello";
    }

}